﻿package com.boyaa.shells.tool.slider
{
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.events.EventDispatcher;
	
	/**
	 * 
	 * @author Kevin
	 */
	public class BasicItem
	{	
		public static var clickTarget:BasicItem = null;	
		
		protected var _itemView:MovieClip = null;	// 父级容器
		protected var _columnCount:int = 7;			// 列数
		protected var _isSelected:Boolean = false;	// 是否被选中
		protected var _isMouseOver:Boolean = false;
		
		/**
		 * 构造
		 */
		public function BasicItem(itemView:MovieClip, column:int = 0) 		
		{			
			_itemView = itemView;
			_columnCount = column;
		}
		
		/**
		 * 是否选择
		 * @param	isSelect
		 */
		public function select(isSelect:Boolean):void
		{
			
		}
		//
		/**
		 * 单击
		 */
		
		
		/**
		 * 读取数据
		 * @param	data
		 * @param	index
		 */
		public function readData(data:Object, index:int = 0):void		
		{
			
		}
		
		/**
		 * 添加父级对象
		 * @param	parent
		 */
		public function setParent(parent:DisplayObjectContainer):void
		{
			parent.addChild(_itemView);
		}
		
		/**
		 * 设置列宽
		 * @param	widths
		 */
		public function setColumnsWidth(widths:Array):void
		{
			
		}
		
		/**
		 * 移除数据
		 */
		public function removeData():void
		{
			
		}				
		
		/**
		 * 返回ID
		 */
		public function get id():int { return 0; }		
		
		/**
		 * 横坐标
		 */
		public function get x():Number { return _itemView.x; }		
		public function set x(value:Number):void 
		{
			_itemView.x = value;
		}
		
		/**
		 * 竖坐标
		 */
		public function get y():Number { return _itemView.y; }		
		public function set y(value:Number):void 
		{
			_itemView.y = value;
		}
		
		/**
		 * 高度
		 */
		public function get height():Number
		{
			return _itemView.height;
		}
		
		public function get width():Number
		{
			return _itemView.width;
		}
		
		public function get isMouseOver():Boolean { return _isMouseOver; }
		
		public function set isMouseOver(value:Boolean):void 
		{
			_isMouseOver = value;
		}
	}
	
}